// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request'; 
// 定义 API 路径枚举
enum Api {
    SysPosAdd = '/sysPos/AddPos',
    SysPosDelete = '/sysPos/DeletePos',
    SysPosList = '/sysPos/list',
    SysPosUpdate = '/sysPos/UpdatePos',
}

// 定义 API 方法
export const apiSysPosAddPost = (body?: any) =>
    request({
        url: Api.SysPosAdd,
        method: 'post',
        data: body,
    });

export const apiSysPosDeletePost = (body?: any) =>
    request({
        url: Api.SysPosDelete,
        method: 'delete',
        data: body,
    });

export const apiSysPosListGet = (name?: string, code?: string) =>
    request({
        url: `${Api.SysPosList}?Name=${name ?? ''}&Code=${code ?? ''}`,
        method: 'get',
    });

export const apiSysPosUpdatePost = (body?: any) =>
    request({
        url: Api.SysPosUpdate,
        method: 'put',
        data: body,
    });